<template>
  <div id="app">
    <!--<div class="iphoneTop"></div>-->
    <div  class="statebar" :style="{'padding-top': platform == 'ios' && isIphoneX ?'44px': platform == 'ios' && !isIphoneX ? '20px' : 0}"></div>
    <!--<div class="app-wrap" :style="{'padding-top': platform == 'ios' && isIphoneX ?'44px': platform == 'ios' && !isIphoneX ? '20px' : 0}">-->
      <keep-alive>
        <router-view v-if="$route.meta.keepAlive"></router-view>
      </keep-alive>
      <router-view v-if="!$route.meta.keepAlive"></router-view>
    <!--</div>-->
  </div>
</template>
<script>
export default {
  name: 'app',
  data () {
    return {
      platform: window.APP_PLATFORM || 'pc',
      isIphoneX: window.isIphoneX
    }
  },
  created () {
  },
  mounted () {
    Date.prototype.Format = function (fmt) { //eslint-disable-line
      var o = {
        'M+': this.getMonth() + 1, // 月份
        'd+': this.getDate(), // 日
        'h+': this.getHours(), // 小时
        'm+': this.getMinutes(), // 分
        's+': this.getSeconds(), // 秒
        'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
        'S': this.getMilliseconds() // 毫秒
      }
      if (/(y+)/.test(fmt)) { fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length)) }
      for (var k in o) {
        if (new RegExp('(' + k + ')').test(fmt)) { fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length))) }
      }
      return fmt
    }
  }
}
</script>
<style lang="less">
  #app {
    font-family: Arial, Helvetica, 'STHeiti STXihei', 'Microsoft YaHei', Tohoma, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    font-size:12px;
  }
  .app-wrap {
    -webkit-overflow-scrolling: touch;
    /*position: absolute;*/
    /*width: 100%;*/
    /*bottom: 0;*/
  }
  .uploaderBox /deep/.van-uploader__wrapper div {
    height: 65px;
  }
  .uploaderBox /deep/ .van-image {
    width: 95px;
  }
  .uploaderBox /deep/ .van-image img {
    width: 95px;
    height: 65px;
  }
  .view-box {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
  }
  .view-box__content {
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: #fafafa;
    ::-webkit-scrollbar {
      display: none;
    }
  }
  body {
    /*padding: constant(safe-area-inset-top) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);*/
     /*Status bar height on iOS 11.0 */
    padding-top: constant(safe-area-inset-top);
    padding-bottom: constant(safe-area-inset-bottom);
    /* Status bar height on iOS 11+ */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
</style>
